Fixes exist check for db tables