Fixing some things with displaying document on page