restore changes from c981f63d

lost during pull request #4 to f9a90829