Fixes the ngModel issue as proposed by pgodel

- added condition to check if ngModel is undefined, if so we just return