Just in case check that originIndex and targetIndex are greater than -1