set state on outside