fix logging of functions