correct some queries