Link javascripts correctly