the current unique function is not return a promise, i need to add some hard coded timeout to wait until it's done. please wrap the unique function in promise.