fixed issues with hmm and staging