Bug fix for ruby 2