added init calendar logic