Removed the retrieval of getId from the backward_with and forward_with relations loop