Update leo.rb  with exception check cases