add test for chained ref
implement chained refs
0.3.2