changed around some javascript