changed multiple wheres to use where_in