fixed seg fault issue with eventscheduler