fixed bug using readfilesync, readfile and writefile are async...