Remove undefined variable from method call