merging changes for eventhandler and async functions