Fix check on table exist