Fixed a bug of unit enterting map.