fix bugs in Chaining