handling timeouts and socket errors