change obj == nil to obj.nil?, obj != nil to !obj.nil?