fixes for event listening
fixed merge conflicts