added client side error logging