adding promise loop in bracket.js - wip