Fix bug when displaying time interval for #19 when the application resumes to foreground