this prevents crash when activity is restarted after changing the theme