added checks to stoke.rb