Fix for #1322

implements #1322 and fixes it