Added function to get curent cursor position