Fix bug NoMethodError in rescue block