removed undefined variable from return statement