select() keeps timing out