fix file existence check