change connection test to allow for checking connection on-demand