function to change item state is finished.