fix issue that clears mapCanvas