added back in some code that got lost