queries fixes