Checked for the existence of the directory in remove() and cat()