implemented popular post and some sql enhancments