You can use the following features in RIP to help avoid routing loops:
Split-horizon: The split-horizon technique prevents information about routes from exiting the router interface through which the information was received. This prevents small routing loops.
Poison-reverse: Poison-reverse updates explicitly indicate that a network or subnet is unreachable. Poison-reverse updates are sent to defeat large routing loops.
For information on the CLI commands, see Commands used to prevent routing loops in RIP