reworked fix for #1993