added trimming to filters