Add cat out of bounds logic check
Separate link and cat adding logic