added rtl option to reset function