fix stuff with query