fix for renderall in a function