add condition in StochHMM.cpp