how to prevent from exiting?