delete function for replies and fix some issue