Multiple pages not getting resolved properly, race condition with global variable