Fixed little bug with the time calculation