added set and remove support for anonymous functions