modified upgrade checking code to better handle failures and to timeout after 20 mins