changed connection detail source, and replaced hard coded formula with function