Changed the shared instance variable cursor to a method local variable.