fix calling clearTimeout with 'undefined'