Make sure we do not call a GUI function outside GUI thread