Fixing a bug in the record triggering