fixed various bugs with evvents