bug fixes for chap state