tableExists bug fix