fix a bug in calculating accumulated UV energy