handled crashes on back press and orientation change
merged with master