decode it first for registration