bug fix when calling format()