modify Connection files to make them more robust