HM: Max count for while loops; Raise error if exceeded 10000