Synchronized the list and handled what happens when ctrl+c is pressed