under working,  add automaton loading state logic, this is under working and not work yet.