fix shared preferences update