adding in wait functions