refactored checking string length for new task