jQuery closure was missing