setup client side event handlers