Resolve infinite loop