Fixed infinite loop issues and refactored the way posts are retrieved