added a reference collection function and fixed replies function