Change item state only if condition is verified

Otherwise it's not consistent.