sorted check fixed