small changes to js controller