fix a bug for dynamically inputs