add event dispatcher on client side