Make state remember last inserted id