added filtering from database