fixed small bug

fixed bug that prevents application from closing