fix bugs with format