fixed the time bug