fixed another tight loop bug