fixes to connection