corrected bug for py3