added check_connection.