Solve the op and extra_op problems in a function, fix a bug due to the op_kind is negative