"defined" check was missing