add a function interface
added possibility to add an exception