place the conditional statement where fetchData() is called

move it out from the definition
12 jobs for v1.0.0_issue577 in 29 minutes and 17 seconds (queued for 10 seconds)