add testbed && fix bugs in sn