corrected a lot of deadlock conditions
v0.0.5