web page updates only when state changes