Fixed lastID reset mising