fix a bug that cause dynamic overflow