Fixing where clause