Closed the cursor and finished remove sheep upon update database.