exit command added do stop the loop