add client side logic, fixing errors