more PEP8
fixed string type check