bugfixes for promises