add state support to listener, and fix crc