fix error running under Rack
Merge pull request #384 from tdiary/fix_error_under_rack

fix error running under Rack