modified stock_check.rb