Remove a TODO
Fix the function creation in case of exception