puspec update
dding flushing
fixes
adding state and statemanager
adding when