closure for jquery ajax