fix bug when ngModel is not defined