added conditional statements for filter_by