fixing where clause