resolved exceptions, added Connection lost handler