adding hasKey method