fixed bug where cursor could not be moved