Building Sort in RA

Fix #5914