Fixed a bug: when a already checkedout document is opened it'd crash...!!!