Fix bug with $scope.posts being undefined