Issue 21

Fixing unexpected disconnect
https://github.com/Enelar/ed/issues/21