small changes to js and controller