updated js controller