added logic for viewing blog posts