fixed the manage events not to crash