fixing printf bugs