Added event functionality