rewrite to fix possible dead state
0.1.0