undo refactor, wait doesn't work