add email logging
fix filter logic and add logs