add insert function to get last insert rowid