to finish the funciton of Retrieving posts