fix writePath