fixed unlink dir check bug