fixed some JS stuff