Added error handling to stop in connection tests