synchronized methods cause deadlocks now that document is synchronized