Add map clearing to statechange