Fixed a bug in calendar