add method to get the current cursor position