fixed JS error in calendar