simulation stopping mechanism rewritten