function checkKey