Printing error message when key is empty and useSharedPrefs is true