fixes for multiple documents