fixed broken wait