Fixed Null Pointer Exception in toTask(Event event)