aad fix with sort_by