Used apply() instead of commit() on SharedPreferences.Editor