updateState is better