changing context to expected element in eventhandler functions