fixed pg connect logic in Diagnostics