fixed bug: there was a problem when a need and a connection event have the same id