set default value to $scope.data to avoid cookie error with null