fix wrong usage of orm query