client and server-side check