fixed handling of non circular list for findTheBeginningOfCircularList