added related posts function