enable to set state before rendering