Using until rather than sleep