fix some err and bug