fix bad function declaration

(not on global scope, but inside block, which is not allowed in strict mode)