Fix for ruby version >2

String#to_a is not working in Ruby >2