fixed the bug happen in output