fixing an ordering bug