Added change handler

problem when manipulating array length, solve it by adding 'track by
$index' to ng-repeat