updated for ruby 2