Fixing time overflow that result of negative value