implemented q promises lib