added relation attribute sorting