Checking last inserted tid