Update javascript for collections