re-applied fix for GH# 172 which got lost in previous commit