Conventional torsion (dihedral) angle potentials used in molecular dynamics (MD) have a singularity problem when three bonded particles are collinearly aligned. Here, we propose a new type of the torsion angle potential, introducing an angle-dependent modulating function. By carefully tuning the parameters, our method can solve the problematic angle-dependent singularity while being combined with existing coarse-grained (CG) models. We optimized the parameters in the torsion angle potential for popular CG models of biomolecules, based on the statistics over structures deposited in the Protein Data Bank. Furthermore, by comparing our design with previous methods, we show that our new potential has advantages in both computational efficiency and numerical stability. We strongly recommend the usage of our new potential in the CG simulations of flexible molecules.