move the end time to MainActivity