You're right, going to a directory that doesn't exist throws an error. I overlooked that.