change file directory in write