fix for #3019

Solves #3019

Review @devoncarew