Fixed a small infinite loop bug...oops