fixed ordering bug for horizontal rendering