Fixing calendar js error