added validation on client side for input