added sanity check for the key