fixing bugs in synthesis