Wait for queue to clear before resolving promise for result