adjust code to work on RUBY 1.9.3