Reimplemented union with callback and promises