properly moved state to shared