scan select and index insert bug fixed