fixes issue #524

Fixes #524