update and set up for angularjs