I must be crazy. Reimplemented the whole thing with promises.