Change the code from previous one on the ruby-2.1.4 bacause of error occured