fixed reconnection logic
Merge branch 'master' into floomatic