Made the check more general when front-end sends data to the server.