replaced last sleep with boost functions