need to solve ar relation problem on where clause