Modified startEndEpochtime method to set endEpochtime.