fix JS by putting at top of page