Added check for string length to prevent wanrings