[Fix] totalWidth should be dynamic