corrected decoding for 0 key