Fixing ng-if and ng-repeat