Can't convert 'NoneType' object to str implicitly