Changed to not pollute document object
Fixed typo