exiting bug fixed