Working code for connection manager and new/edit connection