prevent nodes from going in an ever increasing n loop