Add support for passing 'except' function