add filter before record in the database and add tests