fixed out of range error for changes at beginning of doc