added GetPosts function