Finally fixed problem with reading from stored prefs