put queryStoryDetails function as callback within queryStoryTitles; was otherwise finishing execution of that before the titleText variable was defined