fix Notice: Undefined variable: field