fixed bug for map size, python3 compatible