fixed prefered_state variable
Merge remote-tracking branch 'other_fork/master'