Continuing to fix frontend JS code