add timeouts and logging