imlementet check on all state updates