got last query working