added a method to add custom functions to queue