renamed waiting function