fixed error messages on application shutdown