fix handling timeouts