added promise pipe and fixed a few issues