injecting output function + input fixes