bug fix

('long' object has no attribute 'encode')