tried to fix putc