change assertion check from str to basestr