add toArray() method to cursor