fixes #2539
Merge pull request #2657 from eminn/fix/2539

fixes #2539