fixing bug creating file