session expiration fix

When session expired an error has been thrown in WidgetManager.php. This fix fixes it.