Fix for issue 451

- fixed the issue #451
- added test
- added example