maybe it has something with cursors.x - maybe it's an empty pointer. check it.
btw - do you get an error or complete crash of application?



Ubi bene, ibi Patria.