fix ActiveRecord error