Add back code that was accidentally removed in last commit