fixed PNConnection (code from Sergey)