Avoid: TypeError: Cannot call method 'resume' of undefined