backported changes to calling timeouts