Updated search feature to correctly load posts