Fixed JS bug when adding activity to a date with existing activity