parameterize wait