changed sql queries