add null check for the bundle to fix the NullPointerException in
onSaveInstanceState() methold