changed toDir to absolute path on server