only return connection when no error