Added back button in activities and error handling