added client end validation