Fixed crash on creating a new text document