reordering query buttons