fix bugs in decomposition