checked for undefined and replaced with defaultValue