client side code - init