check for undefined and return