remove console log, fix error thrown when $scope.user is null