fixed simulation bug