Mweb 965

Do not merge
could you declare `mapData` as variable in scope of this function before doing conditional check above and use `mapData` variable across this function?