Fix for jruby
Updated for jruby