Fixed infinite loop. doh!