Fixed createReply and added a sorting function for replies