added angularjs logic