updating Promise implementation with chaining