Only use jQuery in function scope