Added a property and a counter to check if the connection is broken