close cursor if fetch all records