return last inserted row for create thread