automate setTimeout housekeeping

@zaach, @vladikoff - wanna have a look?

fixes #1010 
Put the error case back.