Bug fix with cursor