put "timeout" processing at end of function
Refactoring of success/failure