fixed negative time bug