update external
fix #20; make connect logic clear
fix #19
fix #19; add statehandler