before changing map