stop the splosions when document is not available
Merge pull request #17 from MauriceButler/document-undefined

stop the splosions when document is not available