fixes on ActiveRecord methods