fixed issues for ruby 2.0, response code not working yet