fixed pw state saving and made it smaller