support type check and coerce