fix KVC and text length judgement bugs