Fixed silly infinite loop