improved cursor behaviour