fixed print funtion