added sdslen guard