fixed potential infinite loop
removed some future code