fix a print crashing bug