surround the whole while(true) in try/catch - not each iteration