fix duplicate call of checkUndefined