don't close connection twice