bugfix CS cast to uint8_t