Added hasKey() method