Fixed callbacks for Rails 4