changed where_field to search database correctly