adding functions to add/remove events