implemented Editfunction for events