fixed calendar insertion memory leak