Fix: unknown column in where clause