updated to promises/a+ spec