added error checking for when user enter directory that does not exist