more thorough undefined checks