Added error message for invalid text length