fixed calender function