fixed up crappy js