also check for undefined for convenience