fix cursor behavior