fix for decoding keys