Fixed infinite loop in Chrome