fixed print function