Changed the condition to return when event is null