Added ng-if for empty lists and fixed  scope bug