fixed to work with jruby