$tableExists is there because we want to sure that the table is there when we query the table.