bugfix of when.js lib switch