implement resolve and reject