updated with angular 1.2