another attempt at catching more errors.
undefined check.