Added check to make sure other directories don't get accessed.