Changed "synchronization" by shared preference with synchronized block