sort posts correctly