ordering bug fix