fix coerce code bug