Checks for client disconnect and removes temporary docs