fixed bug in writing file, free mem sector was clobbering dir entry