fix to properly handle events