fixed silly infinite loop