bugfix: reset lastWriteTime if we close the connection.