fix cursor selection