fixes ordering bug