Added max input size validation