fix file ops bug