fixing print functionality