closed cursors
added volatile to var accessed through many threads