removed ng-init and instead called the function in the controller itself