function::unbatched: add exception handling