Added dropped connections handling and some stuff