write key decode test & fix version check bug