Check for document was already loaded during module initialisation

fix #332 

\cc @deepsweet зацени