Audit function fixed