Finance ministry works with S&P on sovereign credit rating