Update for angularjs compatibility