Implement hasKey method