Modified controller so posts are only fetched if user is logged in for faster page load