Add timeouts instead of waiting forever