bugfix: codegen for promises