added sorting of posts