added key parse logic