added add_post code to posts_index