fix calendar null issue