minor fix: check for exceptions before calling select() again

+ some comments