fixed bug that caused an exception to be thrown when selecting a date in the calendar