Fixed bug with create document