add client side gather function