added resolve function