Rule manager fixes
frixed worng parameter order
auto reconnect on connect error and better error handling