ref
fixed some err code