updated to be also tested in jruby