cursor location preservation added