call wait inside 'ensure' incase it raises a SystemCallError