changed how function was being rendered