Implemented the restarting of a cycle if user does not select last element in branch