fix exception handling bug and fix before-filter arguments bug