change locals to state
close #9