Fixed error with where clause in association