Fixed the issues with events