karthik | MS-260 | added the condition to restrict infinite loop.