improve connection testing