Update  to be more compatible with angularjs's