fix MA sort