fix temp table test logic