fixed null pointer in checkEvent