fixed an issue with events