fix anon JS function