updated, reverted to angularjs code