Ensure that the map is resized after being created to avoid race conditions