replaced ng-show with ng-if

to prevent race condition