made wait interval a param