closing cursor in entry writer