Solution to #1911

Here is the solution to issue #1911