fix the 0-byte file problem