Merge code from dev branch for avoiding multiple concurrent requests of ACS tokens.