correcting the print function