diff --git a/lib/json_schemer/schema/base.rb b/lib/json_schemer/schema/base.rb
index <HASH>..<HASH> 100644
--- a/lib/json_schemer/schema/base.rb
+++ b/lib/json_schemer/schema/base.rb
@@ -93,6 +93,8 @@ module JSONSchemer
           validate_custom_format(instance, formats.fetch(format), &block)
         end
 
+        data = instance.data
+
         if keywords
           keywords.each do |keyword, callable|
             if schema.key?(keyword)
@@ -106,8 +108,6 @@ module JSONSchemer
           end
         end
 
-        data = instance.data
-
         yield error(instance, 'enum') if enum && !enum.include?(data)
         yield error(instance, 'const') if schema.key?('const') && schema['const'] != data
Fix keywords option

`data` was referenced before it was assigned. Need some tests...