changed update scripts for  better performance