Fix customize type for capture template function