fixing bug with readfile