fix build and bugs on client side