Added check_table_exist function