adding wait to ui.py