added text length check