if (relatedPerson != null) {
List<Relationship> existingRelationships = Context.getPersonService().getRelationshipsByPerson(session.getSubmissionActions().getCurrentPerson());
//want to check to see if relationship already exists
for (int i = 0; i < relationshipsToCreate.size(); i++) {
RelationshipType r = relationshipsToCreate.get(i);
String side = roleInRelationship.get(i);
boolean replace = replaceExisting.get(i);
if (r != null) {
//firstCheckToSeeIfWeNeedToCreate
boolean create = true;
for (Relationship er : existingRelationships) {
if (er.getRelationshipType().getId().equals(r.getId())) {
//now check the person is correct
if (side.equals("A")) {
//Relationship already exists
if (er.getPersonB().equals(relatedPerson)) {
create = false;