safer attribute filtering