using jQuery in local scope instead of $ in outer scope.