modified before and after processing to allow for connections with two entities of the same type