minor fix for file directory write