updates dematerialize so can chain correctly
Merge pull request #190 from prabirshrestha/chainDematerialize

update dematerialize so can chain correctly