Bugfix for DS-1459

There was a bug in the solution for DS-1459. This pull request fixes the bug.