Bugfix on async while loop - transformed to do-while to avoid a fast parent process