Changed check criteria from null to undefined