fixed error message, better filtering