Fix file exists check