Add ->done variable to force exit when we know we are done