fixed some JS bs I wished I didn't understand