Added some better logic for map page