Add xhr and fix nextgroup bug