fix calc of time remaining