fix Key parse logic