Bug fix in file existance check