Added handling event function