added isKey function