Fixed shared preference check bug