fixed the output bug