fix file exists check