Added code for events controller