uses apply instead of ng-click