fixed zero issue with totaldepth and total width