added functionality to print on client side