fix bugs on print