Fixed database chrash when retrieving posts