implemented read/write credentials to SharedPreferences