Better handling of connection interruptions