Adjusting to eliminate infinite loop