better start function
bug fixed:state change logical error