closes connection after reading