fix unlink exception in the wrong place