create function for adding events