check state while building and refresh once it changes