better handling of before filter errors