fix potential DOM Exception in reset()