change infer method