add front-end validation