fixed the js so it works