check for definedness prior to calling methods