Added a right method of creating the directory using bufio