added fetch posts function