fix logic error for filtering restricted fields #170