added exception for string length input