Closing connection and destroying upon going back from the app