migrated from Q to when.js promises