bug-fix - the application was not closed correctly