fix wrong queries