Handle NameError and return False