Fixed bug in posts model