added logic that removes the data for the posts from local memory onthe page