make map generation into an async task