Fix coding problem

change re-print with special encode from append-mode to over-write mode