Workaround for onResume exception