added promisejs implementation