added connection and some jquery stuff