fix error on python 2.7.6 : TypeError: coercing to Unicode: need string or buffer, NoneType found