added sorting of replies and only sending one reply