javascript is broken. pure witchcraft