Here you are doing an isNull(audit) check, but it should always be... Oh crap, just saw the var scoping on line 245... my bad.