Properly close document
Unfreeze after everything was loaded