Added front-end validation.