fixed error handling on setBinaryState