fixed ordering bug