strict fix: Don't define functions within conditionals or try blocks.