Add try..finally block for closing Cursor object