Added code for events recieved from server