Checking if data != NULL is causing the event problem!