Fix bug error dails plans

@plan = @plan.nil? ? Array.new:@plan