fix event system bugs