use explicit if checks to avoid false error traps