fix regression from removing nested functions