fix print function bug