removed potential illegal memory usage bug in decompose