fixed a bug in posts helper