jslint fix
promises array length may change