make sure it's a directory and not a file