Changed select to timeout after 1000 sec. 
Uncommented testing code