Proper timeout handling
Add timeout code