cleaner fix for issue 2005

This reverts the changes to #207 and implements a cleaner change