fixed map overlap code