fix Undefined variable