close and reopen the connection to the buffer in case of a problem