added sorting and editing of post data