The problem might be, that the connection has not been closed correctly. Please try to close your connections first, before closing the whole program.