diff --git a/src/mod/endpoints/mod_dingaling/mod_dingaling.c b/src/mod/endpoints/mod_dingaling/mod_dingaling.c
index 8d016cfec7..571bbb073a 100644
--- a/src/mod/endpoints/mod_dingaling/mod_dingaling.c
+++ b/src/mod/endpoints/mod_dingaling/mod_dingaling.c
@@ -414,8 +414,11 @@ static void pres_event_handler(switch_event_t *event)
 	char *rpid = switch_event_get_header(event, "rpid");
 	char *type = switch_event_get_header(event, "event_subtype");
 	char *sql;
-
-
+    
+    if (globals.running != 1) {
+        return;
+    }
+    
 	if (!proto) {
 		switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Error Missing 'proto' header\n");
 		return;
@@ -557,6 +560,9 @@ static void roster_event_handler(switch_event_t *event)
 	void *val;
 	char *sql;
 
+    if (globals.running != 1) {
+        return;
+    }
 
 	if (status && !strcasecmp(status, "n/a")) {
 		status = NULL;