more consistently return undefined instead of null.