Fix file deletion check