quick fix for application not exiting properly