Fixing up JS to match the revamped controller