alternative to wait