that's all the error checks I can do except for putchar()