Fixed issue with exit event