couple fixes to connection