fixed overflow time calculations