Fixes open file if client disconnects