updating base and index to work in rtl