changed sql for setup of tables