cursor logic fixes