This is necessary to prevent errors when the method is called  from the app iframes after an ui refreshing.