Deleted if-else in checkKey()