fix tuple length mismatch bug