fixed problem with putc