properly increment and set last_id attr