added check for file existance that was causing stranding