checking on key and value instead