add anonymous functions to be call while the code runs