introduced a small fix to terminate a widget on app.show()