fixed issues with remembering state