added a where query instead of find_all, due to find_all deprecation