Validate state when modifying