bugs in key_name corrected